﻿<!DOCTYPE html>
<html lang="zh-cmn-Hans">
    <head>
        <meta charset="utf-8">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>云印南天</title>
        <meta name="keywords" content="云印南天" />
        <meta name="description" content="云印南天,云印北洋,南开大学天津大学校园云打印平台" />
        <link href="__CDNLIB__/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
        <link href="__PUBLIC__/css/new.css" rel="stylesheet" type="text/css" />
		<script src="__CDNLIB__/jquery/2.1.1/jquery.min.js"></script>
    </head>
    <body>
    <div class="text-center">
        <h1 class="text-primary">南开北洋云打印平台</h1>
        <p><span class="label label-danger">无需“忧”盘</span> <span class="label label-info">提前打印</span> <span class="label label-warning">随时随地</span> <span class="label label-success">状态可知</span></p>
        </div>
        <main class="container">          
        <div class="col-lg-12">
            <div id="myCarousel" class="carousel slide" data-ride="carousel">
   <!-- 轮播（Carousel）项目 -->
            <div class="carousel-inner">
            <div class="item active">
                <img src="__PUBLIC__/images/map_nku.png" class="index-img" alt="云印南天——云印南天南开大学地图">
             </div>
            <div class="item">
                <img src="__PUBLIC__/images/map_tju.png" class="index-img" alt="云印北洋——云印南天天津大学地图">
            </div>
            </div>
   <!-- 轮播（Carousel）导航 -->
             <a class="carousel-control left-bar" href="#myCarousel" data-slide="prev">&lsaquo;</a>
            <a class="carousel-control right-bar" href="#myCarousel" data-slide="next">&rsaquo;</a>
            </div>       
         </div>
            <SWITCH name="status">
                <CASE value='login'>
                    <div  class="col-md-4 col-md-offset-4 alert">
                    <div class="btn-group-justified">
                        <a class="btn btn-lg btn-success" href="__ROOT__/File/add">GO,去打印！</a>
                    </div>
                    </div>
                </CASE>
              <CASE value='register'>
              <div  class="col-md-4 col-md-offset-4 alert">
                    <div class="btn-group-justified">
                        <a class="btn btn-lg btn-success" href="__ROOT__/User/register">继续完成注册！</a>
                    </div>
                    </div>
              </CASE>
              <DEFAULT/>
                <form class="col-lg-12" method="post" action="__ROOT__/User/auth" onsubmit="return checkForm();">                   
                    <div class="row text-center">
                    <div class="col-lg-4 col-md-5 col-sm-8 col-lg-offset-1 ">
                        <div class="input-group">
                            <span class="input-group-addon">账号</span>
                            <input type="text"  id="name" tabindex="1" name="student_number"  class="form-control" placeholder="学号" pattern="(\d{7}|\d{10})" required>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-5 col-sm-8">
                        <div class="input-group">
                            <span class="input-group-addon">密码</span>
                            <input type="password" tabindex="2" class="form-control" id="pwd" name="password" placeholder="注册用南开URP或天大办公网密码" required>
                        </div>
                    </div>
                    <div class="col-lg-2 col-md-1 col-sm-8">
                        <div class="input-group" id="login">
                        <button id="submit-btn" type="submit" tabindex="3" class="form-control btn btn-success" title="初次密码为南开URP密码或者天大办公网密码">
                            登录（注册）
                        </button >
                        </div>
                    </div>
                </div>
                 <div class="col-sm-8 col-sm-offset-2 alert alert-info">
                        <p id="info" class="text-center"><strong>南开大学</strong>同学首次登录时使,使用<code>ＵＲＰ系统</code>账号密码登录即可完成注册！<br>
                        <strong>天津大学</strong>同学首次登录时使,使用<code>天大办公网</code>账号密码登录即可完成注册！
                        </p>
                 </div>
            </form>
            
    </SWITCH> 
        </main>
        <footer class='copyright text-center'>
            <ul class="list-inline">
                <li> <a href="__URL__/privacy">隐私声明</a></li>
                <li> <a href="__ROOT__/User/forget">找回密码</a></li>
                <li><a href="__ROOT__/Printer/">打印店</a></li>
                <li><a href="https://github.com/nkumstc/print">开源项目</a></li>
                <li><a href="mailto:contactATyunyin.org" onclick="this.href=this.href.replace(/AT/,'&#64;')">联系我们</a></li>
            </ul>
        </footer>
    </body>
    <script src="__CDNLIB__/bootstrap/3.3.0/js/bootstrap.min.js" defer></script>
    <script>
    function checkForm()
    {
        var name = document.getElementById("name").value;
        var btn = document.getElementById("submit-btn");
        var re1 = /^[1][0-4]\d{5}$/;                 // undergraduate stu_num
        var re2 = /^\d{2}[1-2][0|9][0|1|8|9]\d{5}$/; // graduate and P.H.D. stu_num
        var re3=/^[1-3]01[0-4]\d{6}$/;//天大学号
        if(!re1.test(name) && !re2.test(name)&&!re3.test(name))
        {
            document.getElementById("info").innerHTML = "请输入格式正确的学号！(仅支持南开和天大在读学生)";
            document.getElementById("name").focus();
            return false;
        }
        btn.innerHTML = '正在验证中...';
        btn.disabled = true;
        return true;
    }
	//控制图片轮播时间
	$(function(){
		$('#myCarousel').carousel({
			 interval: 1600
			});
	});
    </script>
</html>
